<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><title>Assets Class - Bonfire</title><link rel="stylesheet" type="text/css" href="../../styles/main.css"><script language=JavaScript src="../../javascript/main.js"></script><script language=JavaScript src="../../javascript/prettify.js"></script><script language=JavaScript src="../../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.5 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="Assets_Class"></a>Assets Class</h1><div class=CBody><p>The Assets class works with the Template class to provide powerful theme/ template functionality.</p><p>Version: 3.0a</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#Assets_Class" >Assets Class</a></td><td class=SDescription>The Assets class works with the Template class to provide powerful theme/ template functionality.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Assets_Class.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#Assets_Class.$debug" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">$debug</a></td><td class=SDescription>Whether or not debug messages should be displayed.</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#Assets_Class.$ci" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">$ci</a></td><td class=SDescription>An instance of the CI app</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#Assets_Class.$asset_base" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">$asset_base</a></td><td class=SDescription>The base folder (relative to the template.site_root config setting) that all of the assets are stored in.</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#Assets_Class.$asset_folders" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">$asset_folders</a></td><td class=SDescription>The names of the folders for the various assets. </td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#Assets_Class.$inline_scripts" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">$inline_scripts</a></td><td class=SDescription>An array of inline scripts to be placed at the end of the page.</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#Assets_Class.$external_scripts" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">$external_scripts</a></td><td class=SDescription>An array of external (linked) javascript files to be called at the end of the page.</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#Assets_Class.$styles" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">$styles</a></td><td class=SDescription>An array of css files to be placed at the beginning of the file.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Assets_Class.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Assets_Class.__construct" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">__construct()</a></td><td class=SDescription>This if here solely for CI loading to work. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Assets_Class.init" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">init()</a></td><td class=SDescription>Load the assets config file, and inserts the base css and js into our array for later use. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Assets_Class.css" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">css()</a></td><td class=SDescription>Renders links to stylesheets, with the $asset_url prepended. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Assets_Class.add_css" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">add_css()</a></td><td class=SDescription>Adds a file to be the CSS queue to be rendered out.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Assets_Class.add_js" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">add_js()</a></td><td class=SDescription>Adds scripts to the array to be served with the js() method, below.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Assets_Class.js" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">js()</a></td><td class=SDescription>Renders links to stylesheets, with the $asset_url prepended. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Assets_Class.external_js" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMouseOut="HideTip('tt14')">external_js()</a></td><td class=SDescription>Does the actual work of generating the links to the js files. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Assets_Class.inline_js" id=link15 onMouseOver="ShowTip(event, 'tt15', 'link15')" onMouseOut="HideTip('tt15')">inline_js()</a></td><td class=SDescription>Does the actual work of generating the inline js code. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Assets_Class.image" id=link16 onMouseOver="ShowTip(event, 'tt16', 'link16')" onMouseOut="HideTip('tt16')">image()</a></td><td class=SDescription>A simple helper to build image tags.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Assets_Class.attributes" id=link17 onMouseOver="ShowTip(event, 'tt17', 'link17')" onMouseOut="HideTip('tt17')">attributes()</a></td><td class=SDescription>Converts an array of attribute into a string</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Assets_Class.find_files" id=link18 onMouseOver="ShowTip(event, 'tt18', 'link18')" onMouseOut="HideTip('tt18')">find_files()</a></td><td class=SDescription>Locates file by looping through the active and default themes, and then the assets folder (as specified in the config file).</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.Variables"></a>Variables</h3></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.$debug"></a>$debug</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>private static $debug</td></tr></table></blockquote><p>Whether or not debug messages should be displayed.</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.$ci"></a>$ci</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected static $ci</td></tr></table></blockquote><p>An instance of the CI app</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.$asset_base"></a>$asset_base</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>private static $asset_base</td></tr></table></blockquote><p>The base folder (relative to the template.site_root config setting) that all of the assets are stored in.</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.$asset_folders"></a>$asset_folders</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>private static $asset_folders</td></tr></table></blockquote><p>The names of the folders for the various assets.&nbsp; These are set in the assets config file, and default to &lsquo;js&rsquo;, &lsquo;css&rsquo;, and &lsquo;images&rsquo;.</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.$inline_scripts"></a>$inline_scripts</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected static $inline_scripts</td></tr></table></blockquote><p>An array of inline scripts to be placed at the end of the page.</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.$external_scripts"></a>$external_scripts</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected static $external_scripts</td></tr></table></blockquote><p>An array of external (linked) javascript files to be called at the end of the page.</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.$styles"></a>$styles</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>private static $styles</td></tr></table></blockquote><p>An array of css files to be placed at the beginning of the file.</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.__construct"></a>__construct()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>public function __construct()</td></tr></table></blockquote><p>This if here solely for CI loading to work.&nbsp; Just calls the init( ) method.</p><h4 class=CHeading>Return</h4><p>void</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.init"></a>init()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>public static function init()</td></tr></table></blockquote><p>Load the assets config file, and inserts the base css and js into our array for later use.&nbsp; This ensures that these files will be processed first, in the order the user is expecting, prior to and later-added files.</p><h4 class=CHeading>Return</h4><p>void</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.css"></a>css()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public static function css(</td><td class=PParameter nowrap>$style</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$media</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'screen',</td></tr><tr><td></td><td class=PParameter nowrap>$bypass_inheritance</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>false</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Renders links to stylesheets, with the $asset_url prepended.&nbsp; If a single filename is passed, it will only create a single link for that file, otherwise, it will include any styles that have been added with add_css below.&nbsp; If no style is passed it will default to the theme&rsquo;s style.css file.</p><p>When passing a filename, the filepath should be relative to the site root (where index.php resides).</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$style</td><td class=CDLDescription>The style(s) to have links rendered for.</td></tr><tr><td class=CDLEntry>$media</td><td class=CDLDescription>The media to assign to the style(s) being passed in.</td></tr><tr><td class=CDLEntry>$bypass_inheritance</td><td class=CDLDescription>If true, will skip the check for parent theme styles.</td></tr></table><h4 class=CHeading>Return</h4><p>A string containing all necessary links.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.add_css"></a>add_css()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public static function add_css(</td><td class=PParameter nowrap>$style</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$media</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'screen'</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds a file to be the CSS queue to be rendered out.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$style</td><td class=CDLDescription>The style(s) to be added</td></tr><tr><td class=CDLEntry>$media</td><td class=CDLDescription>The type of media the stylesheet styles.</td></tr></table><h4 class=CHeading>Return</h4><p>void</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.add_js"></a>add_js()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public static function add_js(</td><td class=PParameter nowrap>$script</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$type</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'external',</td></tr><tr><td></td><td class=PParameter nowrap>$prepend</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>false</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds scripts to the array to be served with the js() method, below.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$script</td><td class=CDLDescription>The script(s) to be added to the queue.</td></tr><tr><td class=CDLEntry>$type</td><td class=CDLDescription>Either &lsquo;external&rsquo; or &lsquo;inline&rsquo;</td></tr></table><h4 class=CHeading>Return</h4><p>void</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.js"></a>js()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public static function js(</td><td class=PParameter nowrap>$script</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$type</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'external'</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Renders links to stylesheets, with the $asset_url prepended.&nbsp; If a single filename is passed, it will only create a single link for that file, otherwise, it will include any styles that have been added with add_css below.&nbsp; If no style is passed it will default to the theme&rsquo;s style.css file.</p><p>When passing a filename, the filepath should be relative to the site root (where index.php resides).</p><h4 class=CHeading>Paremeters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$script</td><td class=CDLDescription>The name of the script to link to (optional)</td></tr><tr><td class=CDLEntry>$type</td><td class=CDLDescription>Whether the script should be linked to externally or rendered inline.&nbsp; Acceptable values: &lsquo;external&rsquo; or &lsquo;inline&rsquo;</td></tr></table><h4 class=CHeading>Return</h4><p>void</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.external_js"></a>external_js()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public static function external_js(</td><td class=PParameter nowrap>$new_js</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$list</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>false</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Does the actual work of generating the links to the js files.&nbsp; It is called by the js() method, but can be used on it&rsquo;s own.</p><p>If no script are passed into the first parameter, links are created for all scripts within the self::$external_scripts array.&nbsp; If one or more scripts are passed in the first parameter, only these script files will be used to create links with, and any stored in self::$external_scripts will be ignored.</p><p>Note that links will not be rendered for files that cannot be found, though scripts will full urls are not checked, but are simply included.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$new_js</td><td class=CDLDescription>either a string or an array containing the names of files to link to.</td></tr><tr><td class=CDLEntry>$list</td><td class=CDLDescription>if true, will echo out a list of scriptnames, enclosed in quotes and comma separated.&nbsp; Convenient for using with third-party js loaders.</td></tr></table><h4 class=CHeading>Return</h4><p>void</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.inline_js"></a>inline_js()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>public static function inline_js()</td></tr></table></blockquote><p>Does the actual work of generating the inline js code.&nbsp; All code is wrapped by open and close tags specified in the config file, so that you can modify it to use your favorite js library.</p><p>It is called by the js() method.</p><h4 class=CHeading>Return</h4><p>void</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.image"></a>image()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public static function image(</td><td class=PParameter nowrap>$image</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$extra_attrs</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>array()</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>A simple helper to build image tags.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$image</td><td class=CDLDescription>The name of the image file</td></tr><tr><td class=CDLEntry>$extra_attrs</td><td class=CDLDescription>An of key/value pairs that are attributes that should be added to the tag, such as height, width, class, etc.</td></tr></table><h4 class=CHeading>Return</h4><p>A string containing the image tag.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.attributes"></a>attributes()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>private static function attributes(</td><td class=PParameter nowrap>$attributes</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Converts an array of attribute into a string</p><h4 class=CHeading>Author</h4><p>Dan Horrigan (Stuff library)</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$attributes</td><td class=CDLDescription>An array of key/value pairs representing the attributes.</td></tr></table><h4 class=CHeading>Return</h4><p>A string containing the rendered attributes.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Assets_Class.find_files"></a>find_files()</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>private function find_files(</td><td class=PParameter nowrap>$files</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>array(),</td></tr><tr><td></td><td class=PParameter nowrap>$type</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'css',</td></tr><tr><td></td><td class=PParameter nowrap>$bypass_inheritance</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>false</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Locates file by looping through the active and default themes, and then the assets folder (as specified in the config file).</p><p>Files are searched for in this order...&nbsp; 1 - active_theme/ 2 - active_theme/type/ 3 - default_theme/ 4 - default_theme/type/ 5 - asset_base/type</p><p>Where &lsquo;type&rsquo; is either &lsquo;css&rsquo; or &lsquo;js&rsquo;.</p><p>If the file is not found, it is removed from the array.&nbsp; If the file is found, a full url is created, using base_path(), unless the path already includes &lsquo;http&rsquo; at the beginning of the filename, in which case it is simply included in the return files.</p><p>For CSS files, if a script of the same name is found in both the default_theme and the active_theme folders (or their type sub-folder), they are both returned, with the default_theme linked to first, so that active_theme styles can override those in the default_theme without having to recreate the entire stylesheet.</p><h4 class=CHeading>Access</h4><p>private</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>$files</td><td class=CDLDescription>An array of file names to search for.</td></tr><tr><td class=CDLEntry>$type</td><td class=CDLDescription>Either &lsquo;css&rsquo; or &lsquo;js&rsquo;.</td></tr></table><h4 class=CHeading>Return</h4><p>array           The complete list of files with url paths.</p></div></div></div>

</div><!--Content-->


<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MTitle>Bonfire<div class=MSubTitle>Faster CodeIgniter Development</div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Guides</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="../../files2/installing-txt.html">Installing Bonfire</a></div></div><div class=MEntry><div class=MFile><a href="../../files2/modules/overview-txt.html">Modules Overview</a></div></div><div class=MEntry><div class=MFile><a href="../../files2/auth_notes-txt.html">Understanding Authentication</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Helpers</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MFile><a href="../helpers/address_helper-php.html">Address Helper</a></div></div><div class=MEntry><div class=MFile><a href="../helpers/application_helper-php.html">Application Helper</a></div></div><div class=MEntry><div class=MFile><a href="../helpers/config_file_helper-php.html">Config File Helper</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent3')">Libraries</a><div class=MGroupContent id=MGroupContent3><div class=MEntry><div class=MFile id=MSelected>Assets</div></div><div class=MEntry><div class=MFile><a href="template-php.html">Template</a></div></div><div class=MEntry><div class=MFile><a href="../core_modules/users/libraries/auth-php.html">Auth</a></div></div><div class=MEntry><div class=MFile><a href="Console-php.html">Console</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent4')">Core Overrides</a><div class=MGroupContent id=MGroupContent4><div class=MEntry><div class=MFile><a href="../core/MY_Controller-php.html">Controllers</a></div></div><div class=MEntry><div class=MFile><a href="../core/MY_Model-php.html">MY_Model</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent5')">Core Modules</a><div class=MGroupContent id=MGroupContent5><div class=MEntry><div class=MFile><a href="../core_modules/emailer/libraries/emailer-php.html">Emailer</a></div></div><div class=MEntry><div class=MFile><a href="../core_modules/migrations/libraries/Migrations-php.html">Migrations</a></div></div><div class=MEntry><div class=MFile><a href="../core_modules/roles/models/permission_model-php.html">Permission_model</a></div></div><div class=MEntry><div class=MFile><a href="../core_modules/roles/models/role_model-php.html">Role_model</a></div></div></div></div></div><div class=MEntry><div class=MFile><a href="../controllers/install-php.html">controllers/<wbr>install.php</a></div></div><div class=MEntry><div class=MFile><a href="../core_modules/logs/controllers/developer-php.html">core_modules/.../controllers/<wbr>developer.php</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent6')">Index</a><div class=MGroupContent id=MGroupContent6><div class=MEntry><div class=MIndex><a href="../../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Variables.html">Variables</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Files.html">Files</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Files">Files</option><option value="Functions">Functions</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
HideAllBut([3, 4, 2, 5, 1], 7);// --></script></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>private static $debug</td></tr></table></blockquote>Whether or not debug messages should be displayed.</div></div><div class=CToolTip id="tt2"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected static $ci</td></tr></table></blockquote>An instance of the CI app</div></div><div class=CToolTip id="tt3"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>private static $asset_base</td></tr></table></blockquote>The base folder (relative to the template.site_root config setting) that all of the assets are stored in.</div></div><div class=CToolTip id="tt4"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>private static $asset_folders</td></tr></table></blockquote>The names of the folders for the various assets. </div></div><div class=CToolTip id="tt5"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected static $inline_scripts</td></tr></table></blockquote>An array of inline scripts to be placed at the end of the page.</div></div><div class=CToolTip id="tt6"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>protected static $external_scripts</td></tr></table></blockquote>An array of external (linked) javascript files to be called at the end of the page.</div></div><div class=CToolTip id="tt7"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>private static $styles</td></tr></table></blockquote>An array of css files to be placed at the beginning of the file.</div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>public function __construct()</td></tr></table></blockquote>This if here solely for CI loading to work. </div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>public static function init()</td></tr></table></blockquote>Load the assets config file, and inserts the base css and js into our array for later use. </div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public static function css(</td><td class=PParameter nowrap>$style</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$media</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'screen',</td></tr><tr><td></td><td class=PParameter nowrap>$bypass_inheritance</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>false</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Renders links to stylesheets, with the $asset_url prepended. </div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public static function add_css(</td><td class=PParameter nowrap>$style</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$media</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'screen'</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Adds a file to be the CSS queue to be rendered out.</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public static function add_js(</td><td class=PParameter nowrap>$script</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$type</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'external',</td></tr><tr><td></td><td class=PParameter nowrap>$prepend</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>false</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Adds scripts to the array to be served with the js() method, below.</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public static function js(</td><td class=PParameter nowrap>$script</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$type</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'external'</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Renders links to stylesheets, with the $asset_url prepended. </div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public static function external_js(</td><td class=PParameter nowrap>$new_js</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$list</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>false</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Does the actual work of generating the links to the js files. </div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>public static function inline_js()</td></tr></table></blockquote>Does the actual work of generating the inline js code. </div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>public static function image(</td><td class=PParameter nowrap>$image</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null,</td></tr><tr><td></td><td class=PParameter nowrap>$extra_attrs</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>array()</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>A simple helper to build image tags.</div></div><div class=CToolTip id="tt17"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>private static function attributes(</td><td class=PParameter nowrap>$attributes</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Converts an array of attribute into a string</div></div><div class=CToolTip id="tt18"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>private function find_files(</td><td class=PParameter nowrap>$files</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>array(),</td></tr><tr><td></td><td class=PParameter nowrap>$type</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'css',</td></tr><tr><td></td><td class=PParameter nowrap>$bypass_inheritance</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>false</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Locates file by looping through the active and default themes, and then the assets folder (as specified in the config file).</div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>